<%@page import="cn.edu.hust.sse.software7.class3.entities.EBProduct"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

</head>
<body>
<div style="background-color: silver;">
<%
	List<EBProduct> plist = (List<EBProduct>) session
			.getAttribute("prodList");
	if (null == plist || plist.isEmpty()) {
%>
<div>该目录没有商品！</div>
<%
	} else {
%>
<div style="background-color: activeborder; width: 100%;">
<div>
<form action="/product?method=findProd" method="post"
	style="padding-left: 160px; padding-bottom: 5px; padding-top: 5px;">
<table style="background-color: silver;">
	<tr>
		<td colspan="3"><input name="queryStr"
			style="width: 300px; height: 30px; font-size: x-large;" /></td>
		<td rowspan="2"><input type="submit" value="查询"
			style="width: 70px; height: 60px; font-size: x-large; font-weight: bolder;" /></td>
	</tr>
	<tr>
		<td><input type="radio" name="scope" value="low" />最低价范围</td>
		<td><input type="radio" name="scope" value="bid" />竞标价范围</td>
		<td><input type="radio" name="scope" value="fre" />一口价范围</td>
	</tr>
	<tr>
		<td colspan="2">From:<input type="text" name="from" /></td>
		<td colspan="2">To:<input type="text" name="to" /></td>
	</tr>
</table>
</form>
</div>
</div>
<%
	for (EBProduct prod : plist) {
%>
<div style="background-color: activeborder;">
<table style="margin: 5px;">
	<tr>
		<td rowspan="5"><img src="/image?type=2&id=<%=prod.getProductId()%>"></td>
		<td><b>商品ID:</b></td>
		<td><%=prod.getProductId()%></td>
		<td><b>商品名称:</b></td>
		<td colspan="3"><%=prod.getProductName()%></td>
	</tr>
	<tr>
		<td><b>商品种类:</b></td>
		<td><%=prod.getMyCategoryId()%></td>
		<td><b>商品数量:</b></td>
		<td colspan="3"><%=prod.getMount()%></td>
	</tr>
	<tr>
		<td><b>商品价格:</b></td>
		<td><%=prod.getLowestPrice()%></td>
		<td><b>当前最高价:</b></td>
		<td><%=prod.getHightestBid()%></td>
		<td><b>运费:</b></td>
		<td><%=prod.getTradingPrice()%></td>
	</tr>
	<tr>
		<td colspan="2" ><b>商品描述:</b></td>
		<td colspan="4" >
		<%
			if (null != session.getAttribute("userId")) {
		%>
		<b><a href="/go?page=watchProdDetail&prod2Watch=<%=prod.getProductId()%>">查看该商品</a></b>
		 <b><a href="/go?page=buy&pid2buy=<%=prod.getProductId()%>">购买</a></b>
		<b><a
			href="/user?method=addShopCar&pid2SC=<%=prod.getProductId()%>">添加到购物车</a></b>
		<%
			}
		%>
		</td>
	</tr>
	<tr>
		<td colspan="6"><%=prod.getProductDescription()%></td>
	</tr>
</table>
</div>
<%
	}
%> <%
 	}
 %>
</div>
</body>
</html>